﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SistemaAcademicoBO.Entities;
using SistemaAcademicoDAL;
using SistemaAcademicoBO;

namespace SistemaAcademicoBLL.Managers
{
    public class DegreeCourseManager
    {
        private DegreeCourseDAO degreeCourseDAO;

        public DegreeCourseManager()
        {
            degreeCourseDAO = new DegreeCourseDAO();
        }

        public DegreeCourse GetDegreeCourse(int id)
        {
            return (DegreeCourse)degreeCourseDAO.GetRecord(id);
        }

        public List<DegreeCourse> GetAllDegreeCourses()
        {
            List<IEntity> entityList = degreeCourseDAO.GetAllRecords();
            List<DegreeCourse> degreeCourseList = new List<DegreeCourse>();
            foreach (IEntity entity in entityList)
            {
                degreeCourseList.Add((DegreeCourse)entity);
            }

            return degreeCourseList;
        }

        public void SetDegreeCourse(DegreeCourse degreeCourse)
        {
            degreeCourseDAO.SetRecord(degreeCourse);
        }

        public void RemoveDegreeCourse(int id)
        {
            degreeCourseDAO.RemoveRecord(id);
        }
    }
}

